package com.newland.mesdk.demo.interfaceimpl;

import com.newland.mtype.ModuleType;
import com.newland.mtype.module.common.pin.WorkingKey;
import com.newland.mtype.module.common.swiper.K21Swiper;
import com.newland.mtype.module.common.swiper.MSDAlgorithm;
import com.newland.mtype.module.common.swiper.SwipResult;
import com.newland.mesdk.demo.util.ModuleBase;

/**
 * Created by YJF K21连接方式下的刷卡接口实现
 */
public class K21SwiperInterfaceImpl extends ModuleBase {
	private K21Swiper swiper;

	public K21SwiperInterfaceImpl() {
		swiper = (K21Swiper) factory.getModule(ModuleType.COMMON_SWIPER);
	}

	// 根据二磁道明文计算加密的磁道数据
	public SwipResult k21CalculateTrackData(byte[] secondTrackData, byte[] thirdTrackData, WorkingKey wk, MSDAlgorithm alg) {
		SwipResult swipResult = swiper.calculateTrackData(secondTrackData, thirdTrackData, wk, alg);
		return swipResult;
	}
}
